﻿using Md.Api.Entity.DapperModels.MdDB;
using Md.Api.Model.Manage.SysDictData.Request;
using Md.Dapper.Repositories.Md;

namespace Md.Api.Service.Manage.SysDictData;
/// <summary>
/// 分页获取系统字典数据列表服务
/// </summary>
public class GetSysDictDataPageListService : ApiBase<RequestGetSysDictDataPageListModel>
{
    /// <summary>
    /// 系统字典数据仓储
    /// </summary>
    public SysDictDataRep sysDictDataRep { get; set; }
    /// <summary>
    /// 执行
    /// </summary>
    protected override void ExecuteMethod()
    {
        var model = new SysDictDataModel();

        model.DictLabel = Parameter.DictLabel;
        model.DictValue = Parameter.DictValue;
        model.DictType = Parameter.DictType;
        model.DataType = Parameter.DataType;
        model.IsDefault = Parameter.IsDefault;
        model.Status = Parameter.Status;
        model.CreateBy = Parameter.CreateBy;
        model.UpdateBy = Parameter.UpdateBy;

        var res = sysDictDataRep.GetSysDictDataPageList(model, Parameter.PageIndex, Parameter.PageSize, Parameter.OrderBy, Parameter.IsDesc);

        Result.Data = res;
    }
}
